﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace PYNET.Models
{
    public class RegisterViewModel
    {

        [Required(ErrorMessage = "用户名不能为空")]
        [Display(Name = "用户名")]
        [StringLength(20, ErrorMessage = "用户名长度错误")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "邮箱不能为空")]
        [DataType(DataType.EmailAddress, ErrorMessage = "邮箱格式错误")]
        [EmailAddress(ErrorMessage = "邮箱格式错误")]
        [Display(Name = "邮箱")]
        public string Email { get; set; }

        [Required(ErrorMessage = "密码不能为空")]
        [MinLength(8, ErrorMessage = "密码过短"),MaxLength(16,ErrorMessage = "密码过长")]
        [DataType(DataType.Password, ErrorMessage = "密码格式错误")]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "ConfirmPassword")]
        [Compare("Password", ErrorMessage = "前后密码不符")]
        public string ConfirmPassword { get; set; }

        [Required(ErrorMessage = "邀请问题1不能为空")]
        [Display(Name ="InvCode")]
        public string InvCode { get; set; }

        [Required(ErrorMessage = "邀请问题2不能为空")]
        [Display(Name = "InvCodea")]
        public string InvCodea { get; set; }
    }
}
